package cn.credit.loan.service.postpone;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.credit.loan.dao.postpone.PostponeMapper;
import cn.credit.loan.entity.Postpone;

@Service
@Transactional
public class PostponeServiceImpl implements PostponeService {
	@Autowired
	public PostponeMapper postponeMapper;
	
	/**
	 * 延期还款信息查询
	 */
	@Override
	public List<Postpone> getPostponeList(Postpone postpone) throws Exception {
		List<Postpone> postponelist=postponeMapper.getPostponeList(postpone);
		if(postponelist!=null)
		{
			return postponelist;
		}
		return null;
	}
	/**
	 * 款期还款延期添加
	 */
	@Override
	public boolean getPostponeAdd(Postpone postpone) throws Exception {
		if(postpone!=null){
		int num=postponeMapper.getPostponeAdd(postpone);
		if(num>0)
		{
			return true;
		}
		}
		return false;
	}
	/**
	 * 款期还款延期更新
	 */
	@Override
	public boolean getPostponeUpdate(Postpone postpone) throws Exception {
		if(postpone!=null)
		{
			int num=postponeMapper.getPostponeUpdate(postpone);
			if(num>0)
			{
				return true;
			}
		}
		return false;
	}
	/**
	 * 延期还款信息删除
	 */
	@Override
	public boolean getPostponeDelete(int postponeId) throws Exception {
	
		return postponeMapper.getPostponeDelete(postponeId);
	}

}
